package com.lex.config;

import com.lex.service.BaseService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;

@Slf4j
@Configuration
public class LexCmsSecurityConfig {
    @Resource
    private BaseService baseService;

    @Bean
    public UserDetailsService userDetailsService() {
        //获取登录用户信息
        return username -> baseService.loadUserByUsername(username);
    }

}
